package cn.sxgan.common.entity.vo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @Description: 菜单权限表视图对象
 * @Author: sxgan sxgan@foxmail.com
 * @Date: 2024-09-13
 * @Version: 1.0.0
 **/
@Data
@Schema(name = "SysMenuVO", description = "菜单权限表")
public class SysMenuVO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    
    @Schema(description = "菜单ID")
    @TableId
    private Long menuId;
    
    @Schema(description = "菜单名称")
    @NotEmpty
    private String menuName;
    
    @Schema(description = "父菜单ID")
    @NotEmpty
    private Long parentId;
    
    @Schema(description = "显示顺序")
    private Integer orderNum;
    
    @Schema(description = "请求地址")
    @NotEmpty
    private String url;
    
    @Schema(description = "打开方式（menuItem页签 menuBlank新窗口）")
    @NotEmpty
    private String target;
    
    @Schema(description = "菜单类型（M目录 C菜单 F按钮）")
    @NotEmpty
    private String menuType;
    
    @Schema(description = "菜单状态（0显示 1隐藏）")
    private String visible;
    
    @Schema(description = "是否刷新（0刷新 1不刷新）")
    private String isRefresh;
    
    @Schema(description = "权限标识")
    private String perms;
    
    @Schema(description = "菜单图标")
    private String icon;
    
    @Schema(description = "创建者")
    private String createBy;
    
    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    
    @Schema(description = "更新者")
    private String updateBy;
    
    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    
    @Schema(description = "备注")
    private String remark;
    
    /**
     * 子菜单
     */
    @Schema(description = "备注", type = "String")
    private List<SysMenuVO> childMenu;
    
}